<?php


namespace app\admin\validate;


use think\Validate;

class Video extends Validate
{
    // 验证规则
    protected $rule = [
        'title' => 'require|unique:video',
        'duration' => 'require',
        'video_url' => 'require',
        'vid' => 'require',
        'image' => 'require',
        'sort' => 'require|number',
    ];
    //错误信息
    protected $message = [
        'title.require' => '请输入标题',
        'title.unique' => '标题已存在',
        'duration.require' => '请输入视频时长',
        'video_url.require' => '请输入视频地址',
        'vid.require' => '请选择视频分类',
        'image.require' => '请上传封面图',
        'sort.require' => '请输入排序',
        'sort.number' => '排序只能为数字',
    ];
}